<template>
  <view style="height: 100vh;padding: 0;width: 100vw;position: relative;background-color: #000;">
    <!-- 这里是日签页面 -->
    <DailyAffirmationPage
      :img="bg"
      :logo="logo"
      :year="year"
      :date="date"
      :text="text"
      :qrcode="qrcode"
      :subTextArr="subTextArr"
      :bottomText="bottomText"
      :isTypeSpecial="isTypeSpecial"
    />
    <view style="position: fixed; top: -9999rpx">
    	<!-- #ifdef MP-WEIXIN -->
    	<canvas id="dcanvas" type="2d" style="zoom: 50%;width: 750px; height: 1360px;" />
    	<!-- #endif -->
    	<!-- #ifndef MP-WEIXIN -->
    	<canvas canvas-id="dcanvas" id="dcanvas" style="zoom: 50%;width: 750px; height: 1360px;" />
    	<!-- #endif -->
    </view>
  </view>
</template>

<script>
  import DailyAffirmationPage from '@/subcontractorC/components/DailyAffirmationPage.vue'
  import {getDailyCheckinInfo,checkinDaily} from '@/common/api/dailyCheckin.js'
  export default{
    components:{
      DailyAffirmationPage
    },
    data(){
      return {
        bg:'',
        logo:this.imgBaseURL + '/daily/daily-company-logo.png	',
        qrcode:this.imgBaseURL + '/daily/qrcode-ad-3.png',
        year:this.$dayjs().format('YYYY'),//'2024',
        date:this.$dayjs().format('MM/DD'),//'01/08',
        text:'爱自己，别愤怒，你会感谢情绪稳定的自己。健康和快乐是我的天性。爱自己，别愤怒，你会感谢情绪稳定的自己。健康和快乐是我的天性。',
        subTextArr:['保持健康','乐观'],
        isTypeSpecialStr:'N',
        bottomText:'Talktime 全国连锁咨询中心'
      }
    },
    computed:{
      isTypeSpecial(){
        return this.isTypeSpecialStr == 'Y'
      }
    },
    async onLoad() {
      this.getDailyCheckinInfo()
    },
    methods:{
      async getDailyCheckinInfo(){
        const {data:dRes} = await getDailyCheckinInfo()
        this.bg = dRes.data.img
        this.text = dRes.data.text
        this.isTypeSpecialStr = dRes.data.isTypeSpecial || 'N'
        this.subTextArr = dRes.data.subTextArr.split(',')
        console.log(dRes,'=====dRes getDailyCheckinInfo')
      },
      
    }
  }
</script>

<style>
</style>